package com.chen.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chen.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<User> {

    @Select("select sex,count(*) count from user group by sex")
    List<User>  findMember();


    @Select("SELECT DATE_FORMAT(regtime, '%Y-%m-%d' ) AS time, COUNT(*) AS total FROM user GROUP BY DATE_FORMAT(regtime, '%Y-%m-%d') ORDER BY regtime ")
    List<User> findNumbers();



}
